/*
 *  @ProductName@
 *  Copyright (C) @CopyrightYear@
 *    National Institute of Advanced Industrial Science and Technology (AIST)
 *    Registration Number: @AISTRegistrationNumber@
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package jp.go.aist.six.vuln.service;

import jp.go.aist.six.util.search.Binding;
import jp.go.aist.six.util.search.Limit;
import jp.go.aist.six.util.search.Order;
import jp.go.aist.six.vuln.model.scap.vulnerability.Vulnerability;
import java.util.Collection;
import java.util.List;




/**
 * The VulnerabilityService is a prescription of the interface of
 * the vulnerability service.
 *
 * @author  Akihito Nakamura, AIST
 * @version $Id: VulnerabilityService.java 192 2010-05-31 10:23:05Z nakamura5akihito $
 */
public interface VulnerabilityService
{

    /**
     * Returns the vulnerability information of the specified ID.
     *
     * @param   id
     *  the ID of the vulnerability.
     */
    public Vulnerability getVulnerability( String id )
        throws VulnerabilityServiceException;



//    /**
//     * Returns the vulnerability detail information of the specified ID.
//     *
//     * @param   id
//     *  the ID of the vulnerability.
//     */
//    public VulnerabilityDetail getVulnerabilityDetail( String id )
//        throws VulnServiceException;



    /**
     * Searches for the vulnerabilities that meet the specified filter.
     *
     * @param   filter
     *  the filter for the vulnerabilities.
     * @param   ordering
     *  the ordering of the result objects.
     * @param   limit
     *  the number of the result objects, and the start position.
     * @return
     *  the search result.
     */
    public Collection<Vulnerability> findVulnerability(
                    Binding filter, List<Order> ordering, Limit limit )
    throws VulnerabilityServiceException;



    /**
     * Returns the number of all the vulnerabilities.
     *
     * @return
     *  the number of all the vulnerabilities.
     */
    public int countAllVulnerability()
    throws VulnerabilityServiceException;



    /**
     * Returns the number of vulnerabilities that meet the specified filter.
     *
     * @param   filter
     *  the filter.
     * @return
     *  the number of vulnerabilities that meet the specified criteria.
     */
    public int countVulnerability( Binding filter )
    throws VulnerabilityServiceException;



    /**
     * Returns all the vulnerability IDs.
     *
     * @return
     *  all the vulnerability IDs.
     */
    public Collection<String> getAllVulnerabilityID()
    throws VulnerabilityServiceException;



    /**
     * Searches for the vulnerability IDs that meet the specified filter.
     *
     * @param   filter
     *  the filter for the vulnerabilities.
     * @return
     *  the search result.
     */
    public Collection<String> findVulnerabilityID( Binding filter )
    throws VulnerabilityServiceException;



    /**
     * Executes vulnerability scan for the specified products.
     * For every product in the specified list,
     * the related vulnerabilities are searched and
     * that product-vulnerabilities relation is enclosed with the result.
     * The vulnerabilities are restricted by the specified criteria;
     * i.e. the vulnerabilities that do not meet the given criteria
     * are removed from the result.
     *
     * @param   products
     *  the products to scan.
     * @param   vulnCriteria
     *  the criteria for vulnerabilities.
     * @return
     *  the result of vulnerability scan.
     */
//    public ScanResult scanProducts( ProductList products,
//            SearchCriteria vulnCriteria )
//        throws VulnServiceException;



//    /**
//     * Returns the summary of the vulnerability store.
//     *
//     * @return
//     *  the summary of the vulnerability store.
//     */
//    public VulnStoreSummary getStoreSummary()
//        throws VulnServiceException;




    /**
     * Returns the metadata of the vulnerability store.
     *
     * @return
     *  the metadata of the vulnerability store.
     */
//    public VulnStoreMetaData getStoreMetaData()
//        throws VulnServiceException;

}
// VulnService

/* vim:set tabstop=4:set expandtab:set shiftwidth=4: */

